/*  This file is part of -_-.

    -_- is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    -_- is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with -_-.  If not, see <http://www.gnu.org/licenses/>.

    Copyright 2012-2013 Oliver Katz */

#ifndef __COMMON_TYPES_PAIR_H
#define __COMMON_TYPES_PAIR_H

#include "../data.h"

#define Z_WARNING_PAIR(p, r) Z_WARNING_DATA((&(p->first)), r);Z_WARNING_DATA((&(p->second)), r)

typedef struct
{
    z_data first;
    z_data second;
} _z_pair;

z_data z_pair_new(z_data f, z_data s); //method: create a new pair
z_data *_z_pair_new(z_data *f, z_data *s);
int z_pair_del(z_data *p); //method: delete a pair
z_data *z_pair_first(z_data *p); //method: gets the reference to the first element of the pair
z_data *z_pair_second(z_data *p); //method: gets the reference to the second element of the pair

/// This is like a pair<Ta, Tb> in c++. You get references to the first or second z_data.
///
/// For example, if you've already created a pair:
/// {{*z_pair_first(&pair) = z_data_init(0, 0);}}

#endif
